const { add } = require('../utils/dbTools')
const tableName = 'log';
/**
 * 记录操作日志
 * @params {object} req 请求对象
 * @params {object} data 账号id
 * 
*/
const logAdd = async (req, data) => {
    // 获取客户端ip
    const ip = req.connection.remoteAddress;
    const result = await add({ ...data, ip }, tableName);
    return result;
}
module.exports = {
    logAdd
}